#include "ConfigManager.h"

GLOBAL_NAMESPACE_BEGIN

template<> ConfigManager* Singleton<ConfigManager>::singleton_ = 0;

ConfigManager::ConfigManager()
{
}

ConfigManager::~ConfigManager()
{
    destroy();
}

void ConfigManager::init(const std::string& configFileName)
{
    filePath_ = configFileName;
    config_.readFile(filePath_);
}

void ConfigManager::destroy()
{
    config_.writeFile(filePath_);
}

Config* ConfigManager::getConfig()
{
    return &config_;
}

GLOBAL_NAMESPACE_END